/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __FLGR_MORPHO_BASE_LOG_H
#define __FLGR_MORPHO_BASE_LOG_H

#include <flgrCoreDll.h>
#include <flgrCoreErrors.h>
#include <flgrCoreTypes.h>
#include <flgrCoreData.h>
#include <flgrArithShift.h>

  /************************************** 2D Functions ****************************************/

  EXPORT_LIB FLGR_Ret flgr2d_erode_line_horizontal_log(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB FLGR_Ret flgr2d_dilate_line_horizontal_log(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);

  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgBIT(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgUINT8(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgUINT16(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgUINT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgINT8(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgINT16(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgINT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgFLOAT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_erode_line_horizontal_log_fgFLOAT64(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);

  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgBIT(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgUINT8(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgUINT16(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgUINT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgINT8(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgINT16(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgINT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgFLOAT32(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);
  EXPORT_LIB void flgr2d_dilate_line_horizontal_log_fgFLOAT64(FLGR_Data2D *lineout, FLGR_Data2D *linein, int size);



  /************************************** 1D Functions ****************************************/

  EXPORT_LIB FLGR_Ret flgr1d_erode_log(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB FLGR_Ret flgr1d_dilate_log(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);

  EXPORT_LIB void flgr1d_erode_log_fgBIT(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgUINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgUINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgUINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgFLOAT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_erode_log_fgFLOAT64(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);

  EXPORT_LIB void flgr1d_dilate_log_fgBIT(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgUINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgUINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgUINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgFLOAT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);
  EXPORT_LIB void flgr1d_dilate_log_fgFLOAT64(FLGR_Data1D *lineout, FLGR_Data1D *linein, int size);

  


  static __inline__ void flgr1d_erode_2_points_fgBIT(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						     FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgBIT(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgBIT(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgUINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						       FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgUINT8(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgUINT8(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgUINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgUINT16(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgUINT16(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgUINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgUINT32(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgUINT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						      FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgINT8(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgINT8(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						       FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgINT16(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgINT16(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						       FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgINT32(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgINT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgFLOAT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							 FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgFLOAT32(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgFLOAT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_erode_2_points_fgFLOAT64(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							 FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_inf_shift_right_fgFLOAT64(tmpline, linein, size);
    flgr1d_arith_inf_shift_left_fgFLOAT64(lineout, tmpline, size);
  }



  static __inline__ void flgr1d_dilate_2_points_fgBIT(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						      FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgBIT(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgBIT(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgUINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgUINT8(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgUINT8(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgUINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							 FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgUINT16(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgUINT16(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgUINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							 FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgUINT32(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgUINT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgINT8(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
						       FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgINT8(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgINT8(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgINT16(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgINT16(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgINT16(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgINT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgINT32(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgINT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgFLOAT32(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							  FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgFLOAT32(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgFLOAT32(lineout, tmpline, size);
  }
  static __inline__ void flgr1d_dilate_2_points_fgFLOAT64(FLGR_Data1D *lineout, FLGR_Data1D *linein, 
							  FLGR_Data1D *tmpline, int size) {
    flgr1d_arith_sup_shift_right_fgFLOAT64(tmpline, linein, size);
    flgr1d_arith_sup_shift_left_fgFLOAT64(lineout, tmpline, size);
  }





#endif

#ifdef __cplusplus
}
#endif



